Skip to content

fix(check): Socket scan fails closed — not-logged-in Socket can't pass → 1.25.1 - #100

Merged
sandstream merged 1 commit into
mainfrom
fix/socket-fail-closed
Jun 24, 2026
Merged

sandstream merged 1 commit into
mainfrom
fix/socket-fail-closed

Conversation

@sandstream

Copy link
Copy Markdown
Owner

The bug (false green)

checkSocket treated any non-JSON socket check output as "passed" — catch { /* passed */ } then a bare exit-0 → status: pass, "no supply chain issues detected". So an installed-but-unauthenticated Socket — which appears to run but checks nothing — could report a green supply-chain result and give false assurance you're covered.

Fix (fail closed)

A pass now requires positive proof the scan ran (valid result JSON). Everything else surfaces loudly, never as pass:

  • not logged in → warn: "socket NOT scanning — not logged in; supply chain UNVERIFIED" (+ socket login hint)
  • unparseable output, even with exit 0 → warn: "no parseable result — supply chain UNVERIFIED"
  • non-zero exit → warn: "socket check failed"

Decision logic extracted to a pure classifySocketResult(raw, ok), fixture-tested (6 cases incl. the false-green guard).

Same fail-closed principle as #74 (kit scan); checkSemgrep was already fail-closed (pass requires a successful parse).

Verify

  • scoped tsc clean; check-security tests 16/16 incl. new classifySocketResult suite.

🤖 Generated with Claude Code

checkSocket treated non-JSON `socket check` output as "passed" (catch→pass +
bare exit-0→pass), so an installed-but-unauthenticated Socket — which looks like
it runs but checks nothing — could report green "no supply chain issues" and give
false assurance. Now `pass` requires positive proof the scan ran (valid result
JSON); not-logged-in / unparseable / non-zero-exit all surface as
"socket NOT scanning — supply chain UNVERIFIED" with a socket login hint.
Decision logic extracted to a pure, fixture-tested classifySocketResult.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit a161517 into main Jun 24, 2026
16 checks passed
@sandstream
sandstream deleted the fix/socket-fail-closed branch June 24, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant